package com.stars.services.system;
import com.stars.common.base.ResultMsg;
import com.stars.entity.system.SysRedisEntity;

import com.stars.services.BaseConfigService;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @Title: 系统创建的redis 业务逻辑
 * @author dj
 * @date 2019-10-21 22:32:59
 * @version V1.0
 *
 */
public interface SysRedisConfigServices extends BaseConfigService<SysRedisEntity> {

    /**
     * 添加
     * @param key
     * @param obj
     * @return
     * @throws Exception
     */
    ResultMsg set(String key, String obj) throws Exception;
    ResultMsg set(String key, String obj, Integer day, TimeUnit time) throws Exception;

    /**
     * 返回对象
     * @param key
     * @param tClass
     * @param <T>
     * @return
     * @throws Exception
     */
    <T> T getByKeyToPojo(String key,Class<T> tClass) throws Exception;
    String get(String key) throws Exception;

    /**
     * 返回集合对象
     * @param key
     * @param tClass
     * @param <T>
     * @return
     * @throws Exception
     */
    <T> List<T> getByKeyToList(String key,Class<T> tClass) throws Exception;
    /**
     * 根据id删除
     * @param ids
     * @return
     */
    ResultMsg delByIds(String [] ids)throws Exception;

    /**
     * 根据key 删除
     * @param key
     * @return
     * @throws Exception
     */
    ResultMsg delByKey(String key)throws Exception;

}